SG Window Window Object
FindWindow Method

©1998 by Stinga

Properties     Methods      Events     Constants     Error Codes
Description

Returns first descendent window with matching class name and text.

Syntax

object.FindWindow(className As String, text As String) As Window

Part Description
object The object is expression that evaluates to Window object
className Required. String to search inside the window class name.
text Required. String to search inside the window text.
Remarks

Enumerates all descendent windows and matches specified class name string and text string against window's class and text. If specified strings are substrings of the window's class and text, FindWindow returns Window object attached to the matched window.
Empty string matches always.

Example

Following example shows how to find window created with running application that has string "Basic" in it's text:

Dim w As SGWindow.Window
Set w = Find("Basic")
Public Function Find(sText$) As Window
   Dim w As New SGWindow.Window
   w.AttachActiveWindow
   Set Find = w.FindWindow("", sText)
End Function